<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<table border="1">
    <tr>
        <td  style="background-color: aqua"><a href="{% url 'writeradd'%}">添加</a></td>
        <td style="text-align: center; background-color:gold;font-size: 25px" colspan="6">诗人汇总</td>
    </tr>
    <tr>
        <td colspan="6">
            <form action="{% url 'search' %}" method="post">
                {% csrf_token %}
                    <input type="text" name="title" placeholder="输入要搜索的诗词">
                    <input type="submit" value="搜索">
            </form>
        </td>
    </tr>
    <tr>
        <td>序号</td>
        <td>姓名</td>
        <td>年龄</td>
        <td>性别</td>
        <td>爱好</td>
        <td>朝代</td>
    </tr>

    {% for foo in nowpage.object_list %}
    <tr>
        <td>{{ foo.id }}</td>
        <td><a href="{% url 'showpoem' foo.id%}">{{ foo.name }}</a></td>
        <td>{{ foo.age }}</td>
        <td>{{ foo.sex }}</td>
        <td>{{ foo.hobby }}</td>
        <td>{{ foo.dynasty }}</td>

    </tr>
    {% endfor %}
    <tr>
        <td colspan="6">
            {% if nowpage.number > 1 %}
                <a href="{% url 'index' %}?page={{ lastnumber }}">上一页
            {% endif %}
            <b>第{{ nowpage.number }}页</b>
            {% if nowpage.number < maxpage %}
                <a href="{% url 'index' %}?page={{ nextnumber }}">下一页</a>
            {% endif %}
        </td>
    </tr>

</table>
</body>
</html>